<!doctype html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="icon" href="../dist/img/favicon-32x32.png" sizes="32x32" type="image/png">
    <link rel="icon" href="../dist/img/favicon-16x16.png" sizes="16x16" type="image/png">
    <meta name="keywords" content="响应式后台模板,开源免费后台模板,Bootstrap5后台管理系统模板">
    <meta name="description" content="bootstrap-admin基于bootstrap5的免费开源的响应式后台管理模板">
    <meta name="author" content="ajiho">
    <link rel="stylesheet" href="../lib/bootstrap-icons/font/bootstrap-icons.min.css">
    <link rel="stylesheet" href="../lib/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../dist/css/bootstrap-admin.min.css">
    <title>bootstrap-admin开源免费响应式后台管理系统模板</title>
</head>

<body class="bg-body-tertiary py-3">
<div class="container-fluid">
    <div class="row g-3">
        
        <div class="col-12">
            <div class="card border-0 shadow-sm">
                <div class="card-header bg-body">
                    借阅记录
                </div>
                <div class="card-body">
                    <div class="bsa-timeline1-wrapper">
<?php    
//连接数据库
$link=mysqli_connect('127.0.0.1','root','root','books-system');
mysqli_set_charset($link, 'utf8');
//返回借阅记录
$query = "select * from lend  order by id desc ;";
$result=mysqli_query($link, $query);
$data=mysqli_fetch_all($result,MYSQLI_ASSOC);
//显示结果
foreach($data as $v) {
    $id=$v['id'];
    $date=$v['create_at'];
    $username=$v['username'];
    $bookname=$v['bookname'];
    $statu=$v['statu'];
    if ($statu==0) {
        $statue= "借阅";
    }else{
        $statue= "归还";
    }
    if ($id%2 == 0) {
        $class = "bsa-timeline1-left";
    }else{
        $class = "bsa-timeline1-right";
    }
    
    echo    '<div class="bsa-timeline1 ';
    echo    $class;
    echo    '"><div class="card"><div class="card-body"><h5 class="card-title">日期：';
    echo    $date,$statue;
    echo    '</h5><h6 class="card-subtitle mb-2 text-body-secondary">借阅人：';
    echo    $username;
    echo    '</h6><p class="card-text">书籍名称：';
    echo    $bookname;
    echo    '</p></div></div></div>';
    
}



?>
                        <!-- <div class="bsa-timeline1 bsa-timeline1-left">
                            <div class="card">
                                <img src="../dist/img/edge.jpg" class="card-img-top" alt="...">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月15日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">张三</h6>
                                    <p class="card-text">
                                       海的女儿
                                    </p>
                                    <a href="javascript:" class="btn btn-primary">更多</a>
                                </div>
                            </div>
                        </div> -->
                       
                        <!-- <div class="bsa-timeline1 bsa-timeline1-left">
                            <div class="card">
                                <img src="../dist/img/edge.jpg" class="card-img-top" alt="...">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月15日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">张三</h6>
                                    <p class="card-text">
                                       海的女儿
                                    </p>
                                    <a href="javascript:" class="btn btn-primary">更多</a>
                                </div>
                            </div>
                        </div> -->
                        
                        <!-- <div class="bsa-timeline1 bsa-timeline1-right">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月14日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">李四</h6>
                                    <p class="card-text">
                                        钢铁是怎样炼成的
                                    </p>
                                </div>
                            </div>
                        </div>


                        <div class="bsa-timeline1 bsa-timeline1-left">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月13日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">王五</h6>
                                    <p class="card-text">
                                        活着
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="bsa-timeline1 bsa-timeline1-right">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月12日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">老六</h6>
                                    <p class="card-text">
                                        PHP是世界上最好的语言
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="bsa-timeline1 bsa-timeline1-left">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月11日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">三七</h6>
                                    <p class="card-text">
                                        红楼梦
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="bsa-timeline1 bsa-timeline1-right">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月10日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">霍金斯阿达</h6>
                                    <p class="card-text">
                                        百年孤独
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="bsa-timeline1 bsa-timeline1-left">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月9日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">张伟</h6>
                                    <p class="card-text">
                                        动物农场
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="bsa-timeline1 bsa-timeline1-right">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">2024年1月8日</h5>
                                    <h6 class="card-subtitle mb-2 text-body-secondary">小三</h6>
                                    <p class="card-text">
                                        福尔摩斯探案
                                    </p>
                                </div>
                            </div>
                        </div> -->
                        
                        
                        
                    </div>
                </div>
            </div>
        </div>


    </div>

</div>
<!--回到顶部开始-->
<a href="javaScript:" class="bsa-back-to-top"><i class='bi bi-arrow-up-short'></i></a>
<!--回到顶部结束-->


<script src="../lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="../lib/jquery/dist/jquery.min.js"></script>
<script src="../dist/js/bootstrap-admin.min.js"></script>
<script src="../dist/js/app.js"></script>
<!--假数据模拟,生产环境中请直接删除该js-->
<!-- <script src="../dist/js/bootstrap-admin.mock.js"></script> -->

</body>
</html>